#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/wait.h>
int main()
{
    printf("我变成了一个进程: pid:%d\n", getpid());
    pid_t id = fork();
    if (id == 0)
    {
        execl("/usr/bin/ls", "ls", "-a", "-l", NULL);
        exit(0);
    }

    wait(NULL);
    printf("代码运行中......\n");
    printf("代码运行中......\n");
    printf("代码运行中......\n");
    printf("代码运行中......\n");
    printf("代码运行中......\n");
    printf("代码运行中......\n");

    return 0;
}
